<head>
	<script type="text/javascript">
		var aJaxURL	= "server-side/report/records.action.php";
		var aJaxURL1	= "server-side/report/records1.action.php";	//server side folder url
		var tName	= "example";
		var tbName		= "tabs";												//table name
		
		$(document).ready(function () {
			
			GetTabs("tabs");
			GetDate("search_start_my");
			GetDate("search_end_my");
			GetDate("search_start_my_ts");
			GetDate("search_end_my_ts");
			var start	= $("#search_start_my").val();
	    	var end		= $("#search_end_my").val();
			LoadTable(start,end);
		});
		$(document).on("tabsactivate", "#tabs", function() {
        	var tab = GetSelectedTab(tbName);
        	if (tab == 0) {
        		LoadTable();
         	}else if(tab == 1){
         		var start	= $("#search_start_my_ts").val();
    	    	var end		= $("#search_end_my_ts").val();
         		LoadTable1(start,end);
         	}
        });
		function LoadTable(start, end){
			var start	= $("#search_start_my").val();
	    	var end		= $("#search_end_my").val();
			/* Table ID, aJaxURL, Action, Colum Number, Custom Request, Hidden Colum, Menu Array */
			GetDataTable(tName, aJaxURL, "get_list", 6, "start=" + start + "&end=" + end, 0, "", 1, "desc");
		}
		function LoadTable1(start, end){
			/* Table ID, aJaxURL, Action, Colum Number, Custom Request, Hidden Colum, Menu Array */
			GetDataTable("example1", aJaxURL1, "get_list", 6, "start=" + start + "&end=" + end, 0, "", 1, "asc");
		}

		$(document).on("change", "#search_start_my", function () {
	    	var start	= $(this).val();
	    	var end		= $("#search_end_my").val();
	    	LoadTable(start, end, status);
	    });
	    
	    $(document).on("change", "#search_end_my", function () {
	    	var start	= $("#search_start_my").val();
	    	var end		= $(this).val();
	    	LoadTable(start, end);
	    });
	    
	    $(document).on("change", "#search_start_my_ts", function () {
	    	var start	= $(this).val();
	    	var end		= $("#search_end_my").val();
	    	LoadTable(start, end, status);
	    });
	    
	    $(document).on("change", "#search_end_my_ts", function () {
	    	var start	= $("#search_start_my").val();
	    	var end		= $(this).val();
	    	LoadTable(start, end);
	    });
	    
		var record;
		function play(record){
			
			link = 'http://212.72.155.175:8181/records/' + record;
			var newWin = window.open(link, 'newWin','width=420,height=200');
            newWin.focus();
            
		}

	    function play1(record){
			
			link = 'http://212.72.155.175:8181/tsol/' + record;
			var newWin = window.open(link, 'newWin','width=420,height=200');
            newWin.focus();
            
		}
		
	    
    </script>
</head>

<body>
<div id="tabs" style="width: 99%; margin: 0 auto; min-height: 768px; margin-top: 25px;">   
    	<ul>
			<li><a href="#tab-0">შემომავალი ზარები</a></li>
			<li><a href="#tab-1">გამავალი ზარები</a></li>
		</ul>
	<div id="tab-0">
    <div id="container" style="width: 95%;">        	
		            <div id="dynamic">
            	<h2 align="center">ჩანაწერები</h2>
            	<div id="button_area" style="margin-top: 40px;">
            	<div class="left" style="width: 250px;">
	            		<label for="search_start_my" class="left" style="margin: 5px 0 0 9px;">დასაწყისი</label>
	            		<input style="width: 150px; margin-left: 5px; height: 18px;"  type="text" name="search_start_my" id="search_start_my" class="inpt left"/>
	            	</div>
	            	<div class="right" style="">
	            		<label for="search_end_my" class="left" style="margin: 5px 0 0 9px;">დასასრული</label>
	            		<input style="width: 150px; margin-left: 5px; height: 18px;" type="text" name="search_end_my" id="search_end_my" class="inpt right" />
            		</div>
            	</div>		
                <table class="display" id="example">
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width: 100%;">თარიღი</th>
                             <th style="width: 120px;">წყარო</th>
                            <th style="width: 120px;">ადრესატი</th>
                            <th style="width: 120px;">დრო</th>
                            <th style="width: 100%;">ქმედება</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                            	<input type="text" name="search_id" value="ფილტრი" class="search_init" style=""/>
                            </th>
                            <th>
                            	<input type="text" name="search_number" value="ფილტრი" class="search_init hidden-input" style=""></th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" style="width: 100px;"/>
                            </th>                            
                            <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th>
                                <input type="text" name="search_phone" value="ფილტრი" class="search_init" style="width: 90px;"/>
                            </th>
                            <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 90px;" />
                            </th>
                            
                        </tr>
                    </thead>
                </table>
            </div>
            <div class="spacer">
            </div>
        </div>
    </div> 
    <div id="tab-1">
    <div id="container" style="width: 95%;">        	
		            <div id="dynamic">
            	<h2 align="center">ჩანაწერები</h2>
            	<div id="button_area" style="margin-top: 40px;">
            	<div class="left" style="width: 250px;">
	            		<label for="search_start_my_ts" class="left" style="margin: 5px 0 0 9px;">დასაწყისი</label>
	            		<input style="width: 150px; margin-left: 5px; height: 18px;"  type="text" name="search_start_my" id="search_start_my_ts" class="inpt left"/>
	            	</div>
	            	<div class="right" style="">
	            		<label for="search_end_my_ts" class="left" style="margin: 5px 0 0 9px;">დასასრული</label>
	            		<input style="width: 150px; margin-left: 5px; height: 18px;" type="text" name="search_end_my" id="search_end_my_ts" class="inpt right" />
            		</div>
            	</div>	
                <table class="display" id="example1">
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width: 100%;">თარიღი</th>
                             <th style="width: 120px;">წყარო</th>
                            <th style="width: 120px;">ადრესატი</th>
                            <th style="width: 120px;">დრო</th>
                            <th style="width: 100%;">ქმედება</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                            	<input type="text" name="search_id" value="ფილტრი" class="search_init" style=""/>
                            </th>
                            <th>
                            	<input type="text" name="search_number" value="ფილტრი" class="search_init hidden-input" style=""></th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" style="width: 100px;"/>
                            </th>                            
                            <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th>
                                <input type="text" name="search_phone" value="ფილტრი" class="search_init" style="width: 90px;"/>
                            </th>
                            <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 90px;" />
                            </th>
                            
                        </tr>
                    </thead>
                </table>
            </div>
            <div class="spacer">
            </div>
        </div>
    </div>
</div>
</body>